package edu.webtek.graven;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/logout")
public class ShopLogout extends ShopBase{
	private static final long serialVersionUID = 4968577877250477538L;
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doGet(req, resp);
		if(getSessionData().isLoggedIn()){
			getSessionData().logout();
			resp.sendRedirect("/Webtek/");
			return;
		}
	}
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req,resp);
	}
}
